//
//  NetWorkManager.h
//  HdStore
//
//  Created by zhenqiu on 15/11/23.
//  Copyright (c) 2015年 zhenqiu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
#import "Common.h"
#import "EncryptRequestAction.h"
#import "EncryptResponseAction.h"
#import "FSRequestAction.h"
#import "FSResponseAction.h"

typedef enum {
    
    GET_M,
    POST_M,
    POST_MF,
    PUT_M,
    DELETE_M,
    HEAD_M,
    PATCH_M
    
}RequestType;





// afnetwork callback
typedef void (^CompletionBlock)(id __nullable responseObject,NSError * __nullable error);


@interface NetWorkManager : NSObject
{
    AFHTTPSessionManager * sessionManager;
}
@property (nonatomic,strong,nonnull) AFHTTPSessionManager   * sessionManager;


+(nonnull instancetype) getInstance;

-(void)requestWithUrl:(nonnull NSString * )url withParameters:(nullable id)parameters withCompletion:(nullable CompletionBlock)block;
-(void)requestWithUrl:(nonnull NSString *)url withParameters:(nullable id)parameters withFormData:(nullable NSData*)data withCompletion:(nullable CompletionBlock)block;

-(void) postWithUrl:(nonnull NSString *) url withParameters:(nullable id) parameters withCompletion:(nullable CompletionBlock) block;


@end
